import request from '@/utils/request'

export function getListApi(params) {
  return request({
    url: '/park/enterprise',
    params
  })
}

export function getIndustryListApi() {
  return request({
    url: '/park/industry'
  })
}

/**
 * 创建企业
 * @param {*} data
 * @returns
 */
export function createEnterpriseApi(data) {
  return request({
    url: '/park/enterprise',
    method: 'POSt',
    data
  })
}

/**
 * 查询企业详情
 * @param {*} id
 * @returns
 */
export function getEnterpriseDetailApi(id) {
  return request({
    url: `/park/enterprise/${id}`
  })
}

/**
 * 编辑企业
 * @param {*} data
 * @returns
 */
export function updateEnterpriseApi(data) {
  return request({
    url: '/park/enterprise',
    method: 'PUT',
    data
  })
}

export function addRentAPi(data) {
  return request({
    url: '/park/enterprise/rent',
    method: 'POST',
    data
  })
}

export function getRentListApi(id) {
  return request({
    url: `/park/enterprise/rent/${id}`
  })
}

/**
 * 退租
 * @param {} rentId
 * @returns
 */
export function outRentApi(rentId) {
  return request({
    url: `/park/enterprise/rent/${rentId}`,
    method: 'PUT'
  })
}

/**
 * 删除租赁合同
 * @param {*} rentId
 * @returns
 */
export function delRentApi(rentId) {
  return request({
    url: `/park/enterprise/rent/${rentId}`,
    method: 'DELETE'
  })
}
